Embedded animation example

This notebook demonstrates how to generate simple embedded animations in Jupyter.

Adapted from: http://louistiao.me/posts/notebooks/embedding-matplotlib-animations-in-jupyter-as-interactive-javascript-widgets/

First example is a simple line plot

First initialize a figure, axis, and line object

define an init function. This will be called once to initialize the plot.

define an animate function. This will be called once per frame

define the animation itself

Render the animation as an html5 video. This requires ffmpeg to be installed.

Render the animation as an embedded javascript animation. This does not require ffmpeg and is interactive, which is nice.

Repeat for a 3 dimensional (x, y, z) heatmap/image

Define a function to generate an array

Intitialize a figure, axis, and image object

define our init and animate functions, just like above

Define our animation object

Build an html5 video

Generate a javascript animation